#include <REGX52.H>

void main(){
	int n=1;
	P2=0xfe;
	for(;;){
		if((P3&3)!=3) continue;
		while((P3&3)==3);
		if(!(P3&1)) n<<=1;
		else n>>=1;
		if(!n) n=0x80;
		if(n==0x100) n=1;
		P2=~n;
	}
}